<template>
  <div class="outline-parent">
    <div class="flex-box border-hover-style">
      <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
      </t-image-viewer>
      <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
      </van-image-preview>
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img class="outline-parent-bg" :src="publicUrls + 'free/style17/Level3outlineStyle4.webp'" alt="" />
      <div class="outline">
        <div
          class="outline-title-box"
          :class="{ 'outline-title-box-1': !props.info.value && !props.info.remarks && !props.info.subTitle }"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style17/Level3outlineStyle4Title.webp'})`,
          }"
        >
          <div class="outline-title">{{ props.info.text }}</div>
        </div>
        <div
          class="outline-content"
          :class="{
            content2: props.info.value && !props.info.remarks && !props.info.subTitle,
            content3: props.info.value && !props.info.remarks && props.info.subTitle,

            content4: !props.info.value && !props.info.remarks && props.info.subTitle,
          }"
        >
          <p class="outline-subTitle" v-if="props.info.subTitle">{{ props.info.subTitle }}</p>
          <div class="outline-cover" v-if="props.info.value">
            <div class="cover" @click="ImgVisible = true">
              <img :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
            </div>
          </div>
          <div class="remarks1" v-if="props.info.value && props.info.remarks">
            <TextMax
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="4"
            ></TextMax>
          </div>
          <div
            class="remarks2"
            :class="{
              remarks3: !props.info.subTitle,
            }"
            v-else-if="props.info.remarks"
          >
            <TextMax
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="props.info.subTitle ? 8 : 12"
            ></TextMax>
          </div>
        </div>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free17Style2',
});
</script>

<script setup lang="ts">
import { publicUrls, textType } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style17.vue';
import textMode from '../../../textMode/textMode.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();

const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-right: 140px;
  margin-left: 40px;
}
.Showroom-parent {
  position: absolute;
  top: 11px;
  left: 9px;
  z-index: 21;
}
.flex-box {
  width: 420px;
  height: 684px;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 100px 43px 99px 100px;
  z-index: 20;
  overflow: hidden;
}

.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.outline {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 22;
}
.outline-content {
  width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.outline-title-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 277px;
  height: 67px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  margin-bottom: 10px;
  .outline-title {
    width: 221px;
    color: rgba(151, 40, 19, 1);
    text-align: center;
    font-family: 'SJxingkai-C';
    font-size: 22px;
    line-height: 28px;
  }
}
.outline-title-box-1 {
  margin-top: -58px;
}
.outline-subTitle {
  width: 277px;
  color: rgba(255, 227, 162, 0.8);
  opacity: 0.8;
  text-align: center;
  font-family: 'PingFang SC';
  font-size: 17px;
  line-height: 28px;
  margin-bottom: 10px;
}
.outline-cover {
  width: 220px;
  height: 220px;
  margin-bottom: 10px;
  display: flex; 
  justify-content: center;
  align-items: center; 
  overflow: hidden;
  position: relative;
  border-radius: 50%;
  .cover {
    width: 220px;
    height: 220px;
    overflow: hidden;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    &:hover img {
      transform: scale(1.2);
    }
    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      overflow: hidden;
      border-radius: 50%;
      transition: all 0.3s ease;
    }
  }
}
.content2 {
  .outline-cover {
    // margin-top: 145px;
  }
}
.content3 {
  .outline-subTitle {
    // margin-top: 100px;
  }
}
.content4 {
  .outline-subTitle {
    // margin-top: 100px;
  }
}
.remarks1 {
  width: 277px;
}
.remarks2 {
  width: 277px;
}
.remarks3 {
  width: 277px;
}
::v-deep .van-text-ellipsis {
  text-align: justify;
  font-family: PingFang SC !important;
  font-size: 16px !important;
  line-height: 28px !important;
  color: rgba(255, 227, 162, 0.8) !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: rgba(255, 227, 162, 0.8) !important;
  font-weight: 600 !important;
  font-family: 'PingFangSC';
}
</style>